package top.dugou.dugou_sso_server.service.impl;

import org.springframework.stereotype.Service;
import top.dugou.dugou_sso_server.entity.Admin;
import top.dugou.dugou_sso_server.mapper.AdminMapper;
import top.dugou.dugou_sso_server.service.AdminService;

import javax.annotation.Resource;
import java.util.List;
@Service
public class AdminServiceImpl implements AdminService {
    @Resource
    private AdminMapper adminMapper;

    @Override
    public int addAdmin(Admin admin) {
        return adminMapper.insert(admin);
    }

    @Override
    public int delAdmin(Long id) {
        return adminMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int updateAdmin(Admin admin) {
        return adminMapper.updateByPrimaryKey(admin);
    }

    @Override
    public Admin findById(Long id) {
        return adminMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Admin> selectByCondition(Admin admin) {
        return adminMapper.selectByCondition(admin);
    }
}
